#pragma once

#include "SAXContentHandlerImpl.h"
#include "TwitterStatus.h"

/*!
 * \brief   Adds new TwitterStatus objects to the beginning of a list
 */
class AtomContentHandler : public SAXContentHandlerImpl
{
public:
  AtomContentHandler(CAtlList<TwitterStatus>& timelineUI);
  virtual ~AtomContentHandler(VOID);

public:
  HRESULT STDMETHODCALLTYPE startElement( 
            /* [in] */ const wchar_t __RPC_FAR *pwchNamespaceUri,
            /* [in] */ int cchNamespaceUri,
            /* [in] */ const wchar_t __RPC_FAR *pwchLocalName,
            /* [in] */ int cchLocalName,
            /* [in] */ const wchar_t __RPC_FAR *pwchRawName,
            /* [in] */ int cchRawName,
            /* [in] */ ISAXAttributes __RPC_FAR *pAttributes);

  HRESULT STDMETHODCALLTYPE characters( 
            /* [in] */ const wchar_t __RPC_FAR *pwchChars,
            /* [in] */ int cchChars);

  HRESULT STDMETHODCALLTYPE endElement( 
            /* [in] */ const wchar_t __RPC_FAR *pwchNamespaceUri,
            /* [in] */ int cchNamespaceUri,
            /* [in] */ const wchar_t __RPC_FAR *pwchLocalName,
            /* [in] */ int cchLocalName,
            /* [in] */ const wchar_t __RPC_FAR *pwchRawName,
            /* [in] */ int cchRawName);

private:
  TwitterElement _twitterElement;

  CString _date;
  CString _id;
  CString _text;
  CString _source;

  BOOL _inUser;
  CString _screenName;
  CString _profileImageUrl;

  CAtlList<TwitterStatus>& _timelineUI;
};
